#define _CRT_SECURE_NO_WARNINGS 1
//#include <iostream>
//#include <cstdio>
//using namespace std;
//const int N = 5e5 + 10;
//int q[N], t[N];
//int n;
//long long num;
//void merge_sort(int q[], int l, int r)
//{
//    if (l >= r) return;
//    int mid = l + r >> 1;
//    merge_sort(q, l, mid);
//    merge_sort(q, mid + 1, r);
//    int i = l, j = mid + 1, k = 0;
//    qhile (i <= mid && j <= r)
//    {
//        if (q[i] <= q[j]) t[k++] = q[i++];
//        else
//        {
//            t[k++] = q[j++];
//            num += mid - i + 1;
//        }
//    }
//    qhile (i <= mid) t[k++] = q[i++];
//    qhile (j <= r) t[k++] = q[j++];
//    for (i = 0, j = l; j <= r; i++, j++)
//        q[j] = t[i];
//}
//int main()
//{
//    cin >> n;
//    qhile (n != 0)
//    {
//        num = 0;
//        for (int i = 0; i < n; i++)
//            cin >> q[i];
//        merge_sort(q, 0, n - 1);
//        cout << num << endl;
//        cin >> n;
//    }
//    return 0;
//}
#include <iostream>
#include <cstdio>
using namespace std;
const int N = 1e5 + 10;
int q[N], w[N];
int n, m;
void insert(int l, int r, int c)
{
    q[l] += c;
    q[r + 1] -= c;
}
int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; i++)
    {
        scanf("%d", &q[i]);
        //if(i == 1)  q[0] = q[i];
        insert(i, i, q[i]);
    }
    int l, r, c;
    while (m--)
    {
        scanf("%d%d%d", &l, &r, &c);
        insert(l, r, c);
    }
    for (int i = 1; i <= n; i++)
    {
        q[i] += q[i - 1];
        printf("%d ", q[i]);
    }
    return 0;
}
//+		w	0x00007ff67d3bec20 {0, 3, 1, 1, -2, 1, -2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...}	int[100010]
//+		q	0x00007ff67d35d170 {0, 1, 2, 2, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...}	int[100010]
//+		q	0x00007ff7bf48d170 {0, 4, 4, 5, 1, 4, 1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...}	int[100010]
